/******************************************************************************* * Copyright (c) 2012, Project: FP7-ICT-257930 Aniketos * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * - Neither the name of institution nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ /** */ package eu.aniketos.mtm.mapping.impl; import eu.aniketos.mtm.mapping.*; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EDataType; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.impl.EFactoryImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; import org.eclipse.emf.ecore.xml.type.XMLTypeFactory; import org.eclipse.emf.ecore.xml.type.XMLTypePackage; /** * <!-- begin-user-doc --> * An implementation of the model <b>Factory</b>. * <!-- end-user-doc --> * @generated */ public class MappingFactoryImpl extends EFactoryImpl implements MappingFactory { /** * Creates the default factory implementation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static MappingFactory init() { try { MappingFactory theMappingFactory = (MappingFactory)EPackage.Registry.INSTANCE.getEFactory("XSD_mapping_V0.14"); if (theMappingFactory != null) { return theMappingFactory; } } catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new MappingFactoryImpl(); } /** * Creates an instance of the factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public MappingFactoryImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case MappingPackage.ACTIVITY_TYPE: return createActivityType(); case MappingPackage.ACTIVITY_VAR: return createActivityVar(); case MappingPackage.ACTOR_TYPE: return createActorType(); case MappingPackage.BPP_TYPE: return createBPPType(); case MappingPackage.BPR_TYPE: return createBPRType(); case MappingPackage.CONFIDENTIALITY_TYPE: return createConfidentialityType(); case MappingPackage.DOC_TYPE: return createDocType(); case MappingPackage.DOCUMENT_ROOT: return createDocumentRoot(); case MappingPackage.GOAL_TYPE: return createGoalType(); case MappingPackage.INTEGRITY_TYPE: return createIntegrityType(); case MappingPackage.ISA_TYPE: return createIsaType(); case MappingPackage.MAPPING_TYPE: return createMappingType(); case MappingPackage.PARTICIPANT_TYPE: return createParticipantType(); case MappingPackage.PERMISSION_TYPE: return createPermissionType(); case MappingPackage.PLAYS_TYPE: return createPlaysType(); case MappingPackage.RELATES_TO_TYPE: return createRelatesToType(); case MappingPackage.REPRESENTS_TYPE: return createRepresentsType(); case MappingPackage.SO_DBO_DTYPE: return createSoDBoDType(); case MappingPackage.SRA_TYPE: return createSRAType(); case MappingPackage.SRR_TYPE: return createSRRType(); case MappingPackage.THREATS_MAPPING: return createThreatsMapping(); case MappingPackage.THREAT_TYPE: return createThreatType(); case MappingPackage.VAR_TYPE: return createVarType(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object createFromString(EDataType eDataType, String initialValue) { switch (eDataType.getClassifierID()) { case MappingPackage.TYPE_TYPE: return createTypeTypeFromString(eDataType, initialValue); case MappingPackage.TYPE_TYPE1: return createTypeType1FromString(eDataType, initialValue); case MappingPackage.TYPE_TYPE2: return createTypeType2FromString(eDataType, initialValue); case MappingPackage.USERTYPE_TYPE: return createUsertypeTypeFromString(eDataType, initialValue); case MappingPackage.COMMITMENT_ID_TYPE: return createCommitmentIDTypeFromString(eDataType, initialValue); case MappingPackage.COMMITMENT_ID_TYPE1: return createCommitmentIDType1FromString(eDataType, initialValue); case MappingPackage.TYPE_TYPE_OBJECT: return createTypeTypeObjectFromString(eDataType, initialValue); case MappingPackage.TYPE_TYPE_OBJECT1: return createTypeTypeObject1FromString(eDataType, initialValue); case MappingPackage.TYPE_TYPE_OBJECT2: return createTypeTypeObject2FromString(eDataType, initialValue); case MappingPackage.USERTYPE_TYPE_OBJECT: return createUsertypeTypeObjectFromString(eDataType, initialValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String convertToString(EDataType eDataType, Object instanceValue) { switch (eDataType.getClassifierID()) { case MappingPackage.TYPE_TYPE: return convertTypeTypeToString(eDataType, instanceValue); case MappingPackage.TYPE_TYPE1: return convertTypeType1ToString(eDataType, instanceValue); case MappingPackage.TYPE_TYPE2: return convertTypeType2ToString(eDataType, instanceValue); case MappingPackage.USERTYPE_TYPE: return convertUsertypeTypeToString(eDataType, instanceValue); case MappingPackage.COMMITMENT_ID_TYPE: return convertCommitmentIDTypeToString(eDataType, instanceValue); case MappingPackage.COMMITMENT_ID_TYPE1: return convertCommitmentIDType1ToString(eDataType, instanceValue); case MappingPackage.TYPE_TYPE_OBJECT: return convertTypeTypeObjectToString(eDataType, instanceValue); case MappingPackage.TYPE_TYPE_OBJECT1: return convertTypeTypeObject1ToString(eDataType, instanceValue); case MappingPackage.TYPE_TYPE_OBJECT2: return convertTypeTypeObject2ToString(eDataType, instanceValue); case MappingPackage.USERTYPE_TYPE_OBJECT: return convertUsertypeTypeObjectToString(eDataType, instanceValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ActivityType createActivityType() { ActivityTypeImpl activityType = new ActivityTypeImpl(); return activityType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ActivityVar createActivityVar() { ActivityVarImpl activityVar = new ActivityVarImpl(); return activityVar; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ActorType createActorType() { ActorTypeImpl actorType = new ActorTypeImpl(); return actorType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public BPPType createBPPType() { BPPTypeImpl bppType = new BPPTypeImpl(); return bppType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public BPRType createBPRType() { BPRTypeImpl bprType = new BPRTypeImpl(); return bprType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ConfidentialityType createConfidentialityType() { ConfidentialityTypeImpl confidentialityType = new ConfidentialityTypeImpl(); return confidentialityType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public DocType createDocType() { DocTypeImpl docType = new DocTypeImpl(); return docType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public DocumentRoot createDocumentRoot() { DocumentRootImpl documentRoot = new DocumentRootImpl(); return documentRoot; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public GoalType createGoalType() { GoalTypeImpl goalType = new GoalTypeImpl(); return goalType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IntegrityType createIntegrityType() { IntegrityTypeImpl integrityType = new IntegrityTypeImpl(); return integrityType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IsaType createIsaType() { IsaTypeImpl isaType = new IsaTypeImpl(); return isaType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public MappingType createMappingType() { MappingTypeImpl mappingType = new MappingTypeImpl(); return mappingType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ParticipantType createParticipantType() { ParticipantTypeImpl participantType = new ParticipantTypeImpl(); return participantType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public PermissionType createPermissionType() { PermissionTypeImpl permissionType = new PermissionTypeImpl(); return permissionType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public PlaysType createPlaysType() { PlaysTypeImpl playsType = new PlaysTypeImpl(); return playsType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public RelatesToType createRelatesToType() { RelatesToTypeImpl relatesToType = new RelatesToTypeImpl(); return relatesToType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public RepresentsType createRepresentsType() { RepresentsTypeImpl representsType = new RepresentsTypeImpl(); return representsType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SoDBoDType createSoDBoDType() { SoDBoDTypeImpl soDBoDType = new SoDBoDTypeImpl(); return soDBoDType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SRAType createSRAType() { SRATypeImpl sraType = new SRATypeImpl(); return sraType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SRRType createSRRType() { SRRTypeImpl srrType = new SRRTypeImpl(); return srrType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ThreatsMapping createThreatsMapping() { ThreatsMappingImpl threatsMapping = new ThreatsMappingImpl(); return threatsMapping; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ThreatType createThreatType() { ThreatTypeImpl threatType = new ThreatTypeImpl(); return threatType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public VarType createVarType() { VarTypeImpl varType = new VarTypeImpl(); return varType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public TypeType createTypeTypeFromString(EDataType eDataType, String initialValue) { TypeType result = TypeType.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertTypeTypeToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public TypeType1 createTypeType1FromString(EDataType eDataType, String initialValue) { TypeType1 result = TypeType1.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertTypeType1ToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public TypeType2 createTypeType2FromString(EDataType eDataType, String initialValue) { TypeType2 result = TypeType2.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertTypeType2ToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public UsertypeType createUsertypeTypeFromString(EDataType eDataType, String initialValue) { UsertypeType result = UsertypeType.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertUsertypeTypeToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String createCommitmentIDTypeFromString(EDataType eDataType, String initialValue) { return (String)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.STRING, initialValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertCommitmentIDTypeToString(EDataType eDataType, Object instanceValue) { return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.STRING, instanceValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String createCommitmentIDType1FromString(EDataType eDataType, String initialValue) { return (String)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.STRING, initialValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertCommitmentIDType1ToString(EDataType eDataType, Object instanceValue) { return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.STRING, instanceValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public TypeType createTypeTypeObjectFromString(EDataType eDataType, String initialValue) { return createTypeTypeFromString(MappingPackage.Literals.TYPE_TYPE, initialValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertTypeTypeObjectToString(EDataType eDataType, Object instanceValue) { return convertTypeTypeToString(MappingPackage.Literals.TYPE_TYPE, instanceValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public TypeType1 createTypeTypeObject1FromString(EDataType eDataType, String initialValue) { return createTypeType1FromString(MappingPackage.Literals.TYPE_TYPE1, initialValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertTypeTypeObject1ToString(EDataType eDataType, Object instanceValue) { return convertTypeType1ToString(MappingPackage.Literals.TYPE_TYPE1, instanceValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public TypeType2 createTypeTypeObject2FromString(EDataType eDataType, String initialValue) { return createTypeType2FromString(MappingPackage.Literals.TYPE_TYPE2, initialValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertTypeTypeObject2ToString(EDataType eDataType, Object instanceValue) { return convertTypeType2ToString(MappingPackage.Literals.TYPE_TYPE2, instanceValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public UsertypeType createUsertypeTypeObjectFromString(EDataType eDataType, String initialValue) { return createUsertypeTypeFromString(MappingPackage.Literals.USERTYPE_TYPE, initialValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertUsertypeTypeObjectToString(EDataType eDataType, Object instanceValue) { return convertUsertypeTypeToString(MappingPackage.Literals.USERTYPE_TYPE, instanceValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public MappingPackage getMappingPackage() { return (MappingPackage)getEPackage(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @deprecated * @generated */ @Deprecated public static MappingPackage getPackage() { return MappingPackage.eINSTANCE; } } //MappingFactoryImpl